<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="utf-8">
	<title>ScreenNode - Three.js Docs</title>
	<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
	<script src="../scripts/highlight.min.js"></script>
	<link type="text/css" rel="stylesheet" href="../styles/highlight-three.css">
	<link type="text/css" rel="stylesheet" href="../styles/page.css">
</head>
<body>
		<p class="inheritance" translate="no"><a href="EventDispatcher.html">EventDispatcher</a> → <a href="Node.html">Node</a> → </p>
	<h1 translate="no">ScreenNode</h1>
		<section>
			<header>
				<div class="class-description"><p>This node provides a collection of screen related metrics.
Depending on <a href="ScreenNode.html#scope">ScreenNode#scope</a>, the nodes can represent
resolution or viewport data as well as fragment or uv coordinates.</p></div>
			</header>
			<article>
				<div class="container-overview">
					<h2>Constructor</h2>
					<h3 class="name name-method" id="ScreenNode" translate="no">new <a href="#ScreenNode">ScreenNode</a><span class="signature">( scope : <span class="param-type">'coordinate' | 'viewport' | 'size' | 'uv' | 'dpr'</span> )</span> </h3>
					<div class="method">
						<div class="description">
							<p>Constructs a new screen node.</p>
						</div>
						<table class="params">
							<tbody>
								<tr>
									<td class="name">
										<strong>scope</strong>
									</td>
									<td class="description last">
										<p>The node's scope.</p>
									</td>
								</tr>
							</tbody>
						</table>
					</div>
				</div>
				<h2 class="subsection-title">Properties</h2>
				<div class="member">
					<h3 class="name" id="isViewportNode" translate="no">.<a href="#isViewportNode">isViewportNode</a><span class="type-signature"> : boolean</span> <span class="type-signature">(readonly) </span></h3>
					<div class="description">
						<p>This flag can be used for type testing.</p>
						<p>Default is <code>true</code>.</p>
					</div>
				</div>
				<div class="member">
					<h3 class="name" id="scope" translate="no">.<a href="#scope">scope</a><span class="type-signature"> : 'coordinate' | 'viewport' | 'size' | 'uv' | 'dpr'</span> </h3>
					<div class="description">
						<p>The node represents different metric depending on which scope is selected.</p>
<ul>
<li><code>ScreenNode.COORDINATE</code>: Window-relative coordinates of the current fragment according to WebGPU standards.</li>
<li><code>ScreenNode.VIEWPORT</code>: The current viewport defined as a four-dimensional vector.</li>
<li><code>ScreenNode.SIZE</code>: The dimensions of the current bound framebuffer.</li>
<li><code>ScreenNode.UV</code>: Normalized coordinates.</li>
<li><code>ScreenNode.DPR</code>: Device pixel ratio.</li>
</ul>
					</div>
				</div>
				<h2 class="subsection-title">Methods</h2>
					<h3 class="name name-method" id="getNodeType" translate="no">.<a href="#getNodeType">getNodeType</a><span class="signature">()</span><span class="type-signature"> : 'float' | 'vec2' | 'vec4'</span> </h3>
					<div class="method">
						<div class="description">
							<p>This method is overwritten since the node type depends on the selected scope.</p>
						</div>
						<dl class="details">
							<dt class="tag-overrides"><strong>Overrides:</strong> <a href="Node.html#getNodeType">Node#getNodeType</a></dt>
						</dl>
						<dl class="details">
							<dt class="tag-returns"><strong>Returns:</strong> The node type.</dt>
						</dl>
					</div>
					<h3 class="name name-method" id="getUpdateType" translate="no">.<a href="#getUpdateType">getUpdateType</a><span class="signature">()</span><span class="type-signature"> : <a href="global.html#NodeUpdateType">NodeUpdateType</a></span> </h3>
					<div class="method">
						<div class="description">
							<p>This method is overwritten since the node's update type depends on the selected scope.</p>
						</div>
						<dl class="details">
							<dt class="tag-overrides"><strong>Overrides:</strong> <a href="Node.html#getUpdateType">Node#getUpdateType</a></dt>
						</dl>
						<dl class="details">
							<dt class="tag-returns"><strong>Returns:</strong> The update type.</dt>
						</dl>
					</div>
					<h3 class="name name-method" id="update" translate="no">.<a href="#update">update</a><span class="signature">( frame : <span class="param-type"><a href="NodeFrame.html">NodeFrame</a></span> )</span> </h3>
					<div class="method">
						<div class="description">
							<p><code>ScreenNode</code> implements <a href="Node.html#update">Node#update</a> to retrieve viewport and size information
from the current renderer.</p>
						</div>
						<table class="params">
							<tbody>
								<tr>
									<td class="name">
										<strong>frame</strong>
									</td>
									<td class="description last">
										<p>A reference to the current node frame.</p>
									</td>
								</tr>
							</tbody>
						</table>
						<dl class="details">
							<dt class="tag-overrides"><strong>Overrides:</strong> <a href="Node.html#update">Node#update</a></dt>
						</dl>
					</div>
				<h2 class="subsection-title">Source</h2>
				<p>
					<a href="https://github.com/mrdoob/three.js/blob/master/src/nodes/display/ScreenNode.js" translate="no" target="_blank" rel="noopener">src/nodes/display/ScreenNode.js</a>
				</p>
			</article>
		</section>
<script src="../scripts/linenumber.js"></script>
<script src="../scripts/page.js"></script>
</body>
</html>